import { sign, privateImg } from '@/api/common'

export async function getImg(fileId) {
  const _sign = await new Promise((resolve, reject) => {
    sign({ fileId }).then(response => {
      resolve(response.result)
    })
  })
  const _src = await new Promise((resolve, reject) => {
    privateImg({ fileId, sign: _sign }).then(response => {
      resolve(response)
    })
  })
  return window.URL.createObjectURL(_src)
}
